function initNews() {
    //显示新闻关键词
    $('.news_keyword').click(function(){
        $('.news_keyword').hide();
        $('.keyword').show();
    })
    $('.view').click(function(){
        var url = $(this).attr('data-url');
        $.get(url,  function (res) {
            console.log(res);
            if (res.status == 0) {
                layer.msg(res.info);
            } else {
                location.href = res.url;
            }
        })
    })
    
    //发表新闻评论
    $('body').one('click', '.comment', function () {
        var news_id = $('#news_id').val();
        var content = $('#CONTENT').val();
        var url = 'commentNews/news_id/'+news_id+'/content/'+content;
        $.get(url,  function (res) {
            console.log(res);return;
            if (res.status == 0) {
                layer.msg(res.info);
            } else {
                location.href = res.url;
            }
        })
    })
    
    //删除新闻评论
    $('.delComment').click(function(){
        var url = $(this).attr('data-url');
        layer.confirm('确定删除吗', {
            closeBtn: 0,
            btn: ['确定', '取消'] //按钮
        }, function () {
            var index = layer.load(1, {shade: false});
            $.get(url, function (res) {
                console.log(res);
                layer.msg(res.info);
                location.reload();
            })
        }, function (index) {
            layer.close(index);
        });
    })
    
    //回复新闻评论
    $('body').one('click', '.replyComment', function () {
        var news_id = $('#news_id').val();
        var comment_id = $(this).attr('data-id');
        var document_w = $(window).width();
        var document_h = $(window).height();
        var layer_w = '550';
        var layer_h = '550';
        var w = (document_w - layer_w) / 2;
        var h = (document_h - layer_h) / 2;
        layer.open({
            type: 2,
            title: [
                "发表新闻评论",
                'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
            ],
            area: [layer_w + 'px', layer_h + 'px'], //宽高
            offset: [h + 'px', w + 'px'], //弹出位置 [top,left]
            content: "/index.php/Home/Index/layer/type/12/news_id/"+news_id+"/comment_id/"+comment_id
        })
    })
    

}